package com.zmn.oms.zmn.business.interfaces.redistribute;

import com.zmn.common.dto2.AMISListData;
import com.zmn.oms.common.dio.redistribute.CheckApplyRedistributeDIO;
import com.zmn.oms.common.dio.redistribute.EngineerRedistributeQuery;
import com.zmn.oms.common.dio.redistribute.RedistributeWorkQuery;
import com.zmn.oms.common.dio.redistribute.audit.ManagerAuditQuery;
import com.zmn.oms.common.dro.redistribute.EngineerDRO;
import com.zmn.oms.common.dro.redistribute.EngineerWorkRedistributeDRO;
import com.zmn.oms.common.dro.redistribute.OrderWorkRedistributeStatusDRO;
import com.zmn.oms.common.dro.redistribute.audit.ApplyDetailDRO;
import com.zmn.oms.common.dro.redistribute.audit.ApplyItemDRO;
import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.bo.redistribute.CheckApplyRedistributeBO;
import com.zmn.oms.model.bo.redistribute.CheckOperateBO;
import com.zmn.oms.model.entity.work.OrderWork;

import java.util.Date;
import java.util.List;

/**
 * @author sunlife
 * @date:2022/5/9 下午4:44
 * description: 工单改派查询业务类
 */
public interface OrderWorkRedistributeListBService {
    /**
     * 是否可以操作改派
     * @param orderId
     * @param workId
     * @return
     */
    CheckOperateBO checkCanOperateRedistribute(Long orderId, Long workId) throws OmsBaseException;

    /**
     * 检查是否可以发起改派申请
     *
     * @param checkApplyRedistributeDIO
     * @return
     */
    CheckApplyRedistributeBO checkCanApplyRedistribute(CheckApplyRedistributeDIO checkApplyRedistributeDIO) throws OmsBaseException;

    /**
     * 校验工单状态是否可以操作改派
     * @param orderWork
     * @return
     */
    String verifyWorkStatusForRedistribute(OrderWork orderWork, Integer caller) throws OmsBaseException;

    /**
     * 获取审核列表
     * @param query
     * @return
     */
    AMISListData<ApplyItemDRO> listApplyByQuery(ManagerAuditQuery query) throws OmsBaseException;

    ApplyDetailDRO getApplyById(Long redistributeId) throws OmsBaseException;

    List<EngineerWorkRedistributeDRO> listGrabWorkByQuery(RedistributeWorkQuery redistributeWorkQuery);

    List<EngineerDRO> listRedistributeEngineer(Long orderId, Long workId, Date dutyTime);

    List<EngineerDRO> listRedistributeEngineer(EngineerRedistributeQuery query) throws OmsBaseException;

    OrderWorkRedistributeStatusDRO getRedistributeStatusById(Long redistributeId);
}
